$(document).ready(function(){
	//initialize the accordion
	$('.sideNav').accordion({
		header: 'div.header'
	});
	//logic for determining which accordion option should be open by default\
	if ($('body').hasClass('womens')) {
		$('.sideNav').accordion({active: 1});
	} else if ($('body').hasClass('mens')) {
		$('.sideNav').accordion({active: 0});
	}
	setInterval('homeTransitions()', 5000);
});

//homepage transitions
function homeTransitions() {
	if ($('.visible').next().size() > 0) {
		$('.visible').removeClass('visible').fadeOut(function(){
			$('.visible').fadeIn();
		}).next().addClass('visible');
	} else {
		$('.visible').removeClass('visible').fadeOut(function(){
			$('.visible').fadeIn();
		});
		$('.feature_images img:first').addClass('visible')
	}
}